<?php
class NewPassForm extends Zend_Form {
    public function __construct($options = null) 
    {
    	$baseurl = new MHDEV_View_Helper_BaseUrl();
    	
        parent::__construct($options);
        
        $this->setName('newpass');
        
        // Mail
        $mail = new Zend_Form_Element_Text('mail');
        $mail->setLabel(Zend_Registry::get('lang')->_('register_newpass_mail'));
        $mail->setDescription(Zend_Registry::get('lang')->_('register_newpass_dmail'));
        $mail->setRequired(true);
        $mail->addFilter('StringTrim');
        $mail->addFilter('StripTags');
        $mail->addValidator('EmailAddress');
        $mail->setErrorMessages(array(
            0 => Zend_Registry::get('lang')->_('error_login_mail')
        ));
        
      	// captcha 
        $captcha = new Zend_Form_Element_Captcha('captcha', array(
            'label' => Zend_Registry::get('lang')->_('captcha'),
            'captcha' => array(
                'captcha' => 'Image',
                'wordLen' => 6,
                'timeout' => 300,
                'width' => 200,
                'heigth' => 150,
                'imgDir' => 'static/gfx/captcha/',
                'imgUrl' => $baseurl->BaseUrl() . '/static/gfx/captcha/',
                'font' => 'static/gfx/captcha/fonts/gautami.ttf',
                'fontsize' => 28,
				'messages' => array(
					'badCaptcha' => Zend_Registry::get('lang')->_('error_captcha'),
					'missingID' => Zend_Registry::get('lang')->_('error_captcha'),
					'missingValue' => Zend_Registry::get('lang')->_('error_captcha')
				)
			)
		));
		$captcha->setDescription(Zend_Registry::get('lang')->_('captcha_desc'));
        
		// Submit
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel(Zend_Registry::get('lang')->_('form_login'));

		$this->addElements(array($mail, $captcha, $submit));
    }
}  
?>